<?xml version="1.0" encoding="UTF-8"?>
<validateThis xsi:noNamespaceSchemaLocation="http://www.validatevariables.org/validateThis.xsd"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <conditions>
        <condition name="isOffline"
                   serverTest="getOnline() EQ false"/>
        <condition name="isAltLanguages"
                   serverTest="getAlt_Languages() EQ true"/>
        <condition name="isOtherServices"
                   serverTest="getOther_Services() EQ true"/>
        <condition name="isTranslators"
                   serverTest="getTranslators() EQ true"/>
    </conditions>

    <objectProperties>
        <!-- Boolean: Missing value equates to false, no need to add required rules -->
        <property name="Approved">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Deleted">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Online">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Alt_Language_Workshop">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Other_Services">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Translators">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Child_Care">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="FAFSA_On_The_Web">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Financial_Aid_Presentation">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Foster_Youth">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Refreshments">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Separate_Areas">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Small_Group">
            <rule type="boolean" contexts="*" />
        </property>
		<property name="Scholarship_Assistance">
            <rule type="boolean" contexts="*" />
        </property>
        <property name="Tax_Assistance">
            <rule type="boolean" contexts="*" />
        </property>
        <!-- Date/times -->
        <property name="Start_Time">
            <rule type="required" contexts="*" />
            <rule type="time" contexts="*" />
            <rule type="expression" failuremessage="Start time must be before end time.">
                <param name="expression" value="getStart_Time() LT getEnd_Time()" />
            </rule>
            <rule type="expression" contexts="*" failuremessage="Start Time must be noon or later if the workshop date is a weekday">
                <param name="expression" value="((dayOfWeek(getWorkshop_Date()) GT 1 AND dayOfWeek(getWorkshop_Date()) LT 7) AND timeFormat(getStart_Time(), 'HHmmss') gte '120000') OR (dayOfWeek(getWorkshop_Date()) EQ 1 OR dayOfWeek(getWorkshop_Date()) EQ 7)" />
            </rule>
        </property>
        <property name="End_Time">
            <rule type="required" contexts="*" />
            <rule type="time" contexts="*" />
            <rule type="expression" failuremessage="End Time must be after start time.">
                <param name="expression" value="getEnd_Time() GT getStart_Time()" />
            </rule>
        </property>
        <property name="Workshop_Date">
            <rule type="required" contexts="*" />
            <!-- <rule type="futureDate" contexts="*" /> -->
            <rule type="WorkshopDateWithinCurrentRange" contexts="*" />
            <rule type="DoesNotFallOnHolidayWithinWorkshopRange" contexts="*" />
        </property>
        <!-- integers -->
        <property name="Anticipated_Computers">
            <rule type="required" contexts="*" />
            <rule type="integer" contexts="*" />
        </property>
        <property name="Anticipated_Students">
            <rule type="required" contexts="*" />
            <rule type="integer" contexts="*" />
            <rule type="min" contexts="*">
                <param name="min" value="1" />
            </rule>
        </property>
        <property name="Anticipated_Volunteers">
            <rule type="required" contexts="*" />
            <rule type="integer" contexts="*" />
        </property>
        <property name="Organization_ID">
            <rule type="required" contexts="*" />
            <rule type="integer" contexts="*" />
            <rule type="min" contexts="*">
                <param name="min" value="1" />
            </rule>
        </property>
        <property name="Organizer_ID">
            <rule type="required" contexts="*" />
            <rule type="integer" contexts="*" />
            <rule type="min" contexts="*">
                <param name="min" value="1" />
            </rule>
        </property>
        <property name="Site_ID">
            <rule type="required" contexts="*" />
            <rule type="integer" contexts="*" />
            <rule type="min" contexts="*">
                <param name="min" value="1" />
            </rule>
        </property>
        <property name="PB_Survey_Count">
            <rule type="integer" contexts="*" />
        </property>
        <!-- Conditionally required fields -->
        <property name="Offline_Reasons">
            <rule type="required" condition="isOffline" contexts="*" />
        </property>
        <property name="Alt_Language_Workshop">
            <rule type="required" condition="isAltLanguages" contexts="*" />
        </property>
        <property name="Other_Services_Description">
            <rule type="required" condition="isOtherServices" contexts="*" />
        </property>
        <property name="Translator_Languages">
            <rule type="required" condition="isTranslators" contexts="*" />
        </property>
    </objectProperties>
</validateThis>
